package org.example.curriculum_design_6_16.common.auth;

import org.example.curriculum_design_6_16.common.base.BaseException;

/**
 * 认证授权异常
 */
public class AuthException extends BaseException {
    public AuthException(int httpStatus, String errorCode, String message) {
        super(httpStatus, errorCode, message);
    }

    // 预定义异常
    public static AuthException unauthorized() {
        return new AuthException(401, "AUTH_001", "请先登录");
    }

    public static AuthException invalidToken() {
        return new AuthException(401, "AUTH_002", "令牌已失效");
    }

    public static AuthException invalidCredentials() {
        return new AuthException(401, "AUTH_005", "用户名或密码错误");
    }
}